﻿<cfsilent>
	<cfscript>
		
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		propertyAdvice = getProperty("serviceFactory").getBean("studentPropertyAdvice");
				
		event.setArg("pageTitle", "教学运行基础数据 - 学生学籍管理 - 打印成绩证明");
		
		currentTab = event.getArg("TabID", "labSearch");
		
		passArgs = structNew();
		
		studentId = event.getArg("STU");
		
		if ( len(studentId) ) {
			
			structInsert( passArgs, "STU", studentId, true );
			
			currentTab = event.getArg("TabID", "labCatalog");
		}
		
		/* 搜索学生档案 */
		keyword = event.getArg("Keywords");
		
		rs_student = queryNew("stu_id,stu_name,cls_name,student_prop");
		
		if ( len(keyword) ) {
			
			sql = "SELECT 
						 t_student.stu_id, t_student.stu_name, t_class.cls_name, t_student_status.student_prop 
					FROM 
						 t_student 
						 INNER JOIN t_class ON t_class.cls_id = t_student.cls_id 
						 INNER JOIN t_student_status ON t_student_status.stu_id = t_student.stu_id 
					WHERE 
						 (
							 t_student.stu_id LIKE :condition 
							 OR 
							 t_student.stu_name LIKE :condition 
						 )
					ORDER BY 
						 t_student.stu_name "; 
			
			queryObj = new Query( datasource=application.dnsSlave, maxRows=21 );
			queryObj.addParam( name="condition", value=keyword&"%", cfsqltype="cf_sql_varchar" );
			
			rs_student = queryObj.execute( sql=sql ).getResult();
		
		}
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('studentProfile')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">学籍档案</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 application"></i>学生成绩证明
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labSearch">class="active"</cfif> id="labSearch" tabTarget="Search">查找学生</span>
						<cfif len(studentId)>
							<span <cfif currentTab eq "labCatalog">class="active"</cfif> id="labCatalog" tabTarget="Catalog">证明材料</span>
						</cfif>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
						
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
							
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					// -->
					//]]>
				</script>
				
				<div id="Search" class="tabContent">
					
					<form id="formSearch" onSubmit="javascript:return processVerfiyForm('formSearch');" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('studentMarkProve')#</cfoutput>">
						<input type="hidden" name="TabID" value="labSearch" />
						
						<div class="label">
							<b>学号或姓名</b>
							<input name="Keywords" id="Keywords" type="text" class="typeText" verification="required" maxlength="128" value="<cfoutput>#event.getArg('Keywords')#</cfoutput>" />
						</div>
						<hr/>
						<div class="lable">
							<input class="button1" type="submit" value="搜索" />
						</div>
					</form>
					
					<cfif rs_student.recordCount>

						<div class="clearfix">
							<div class="UICardTable">
                                <cfloop query="rs_student">
									
									<cfset structInsert(passArgs, "STU", rs_student.stu_id, true) />
									<cfset propertyAdvice.parseProperty(rs_student.student_prop) />
									
									<dl <cfif not propertyAdvice.getInSchool()>class="disabled"</cfif>>
										<dt>
											<a href="<cfoutput>#buildURL('studentMarkProve', passArgs)#</cfoutput>">
												<em class="people"><!--imgholder--></em>
												<dd>
													<h3><cfoutput>#rs_student.stu_name#</cfoutput> - <cfoutput>#rs_student.cls_name#</cfoutput></h3>
													<p><cfoutput>#rs_student.stu_id#</cfoutput></p>
												</dd>
											</a>
										</dt>
									</dl>
								</cfloop>					
							</div>
						</div>
					
					</cfif>
					
				</div>
				
				<div id="Catalog" class="tabContent">
					
					<div class="noticeBlock">
						<h3>成绩相关证明材料</h3>
						<p><span class="img icon16x16 message"></span>请选择适合的证明材料, 用于打印输出</p>
						<hr/>
					</div>
					
					<div class="clearfix">
						<ul class="UIDashBoard">
							
							<li class="col2">
								<div class="board hasPic">
									<a target="_blank" href="<cfoutput>#buildURL("studentMarkPrint", passArgs)#</cfoutput>">
										<div class="pic">
											<span class="icon64x64 studentMarkPrint"></span>
										</div>
										<div class="content">
											<h3>0<span class="unitPriod">分及以上</span></h3>
											<h5>成绩证明</h5>
											<p class="describ">打印全部成绩</p>
											<p class="describ">常用于评优、评奖, 显示学生在校期间的真实学习记录</p>
										</div>
									</a>
								</div>
							</li>
							
							<li class="col2 last">
								<div class="board hasPic">
									<a target="_blank" href="<cfoutput>#buildURL("studentMarkPassPrint", passArgs)#</cfoutput>">
										<div class="pic">
											<span class="icon64x64 studentMarkPassPrint"></span>
										</div>
										<div class="content">
											<h3>60<span class="unitPriod">分及以上</span></h3>
											<h5>已通过成绩证明</h5>
											<p class="describ">仅打印及格成绩</p>
											<p class="describ">通常用于学生找工作、用人单位推荐等显示度较好的场合</p>
										</div>
									</a>
								</div>
							</li>
							
							<!---
							<li class="col2">
								<div class="board hasPic">
									<a target="_blank" href="<cfoutput>#buildURL("studentMarkEnglishPrint", passArgs)#</cfoutput>">
										<div class="pic">
											<span class="icon64x64 studentMarkEnglishPrint"></span>
										</div>
										<div class="content">
											<h3>English</h3>
											<h5>英文成绩证明</h5>
											<p class="describ">打印英文成绩单</p>
											<p class="describ">用于申请出国留学签证或国外交换生</p>
										</div>
									</a>
								</div>
							</li>
							--->
							
						</ul>
					</div>
					
				</div>
			
			</div>
		</li>
	</ul>
</div>